package com.ldy.transactional;

import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;

@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(locations = {"classpath:transactional/app-*.xml"})
public class StudentServiceTestV2 {
    @Autowired
    StudentService studentService;


    @Test
    public void saveNoCatch() throws Exception {
        studentService.saveNoCatch();
    }

    @Test
    public void save1Catch() throws Exception {
        studentService.saveCatch();
    }

    @Test
    public void save1CatchthrowRuntimeException() throws Exception {
        studentService.saveCatchthrowRuntimeException();
    }

}